package com.carSys.Controller;

import com.carSys.DTO.TaskTypeAssignmentPercentageDTO;
import com.carSys.Service.TaskTypeAssignmentPercentageDTOService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/carsys/taskTypeAssignmentPercentage")
public class TaskTypeAssignmentPercentageDTOController {

    @Autowired
    private TaskTypeAssignmentPercentageDTOService taskTypeAssignmentPercentageDTOService;

    @GetMapping("/allCompletedAssignmentsCountByTaskType/{month}")
    public List<TaskTypeAssignmentPercentageDTO> getAllCompletedAssignmentsCountByTaskType(@PathVariable int month) {
        return taskTypeAssignmentPercentageDTOService.getAllCompletedAssignmentsCountByTaskType(month);
    }

    @GetMapping("/allAcceptedAssignmentsCountByTaskType/{month}")
    public List<TaskTypeAssignmentPercentageDTO> getAllAcceptedAssignmentsCountByTaskType(@PathVariable int month) {
        return taskTypeAssignmentPercentageDTOService.getAllAcceptedAssignmentsCountByTaskType(month);
    }
}
